﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ZenSystemService.Api.Migrations
{
    /// <inheritdoc />
    public partial class OrderCreatedDate : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {

            migrationBuilder.AddForeignKey(
                name: "FK_InstitutionSalesOrderItems_ProductTypes_ProductTypeId",
                table: "InstitutionSalesOrderItems",
                column: "ProductTypeId",
                principalTable: "ProductTypes",
                principalColumn: "ProductTypeId",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_ProductTypes_DeviceTypes_DeviceTypeId",
                table: "ProductTypes",
                column: "DeviceTypeId",
                principalTable: "DeviceTypes",
                principalColumn: "DeviceTypeId");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_InstitutionSalesOrderItems_ProductTypes_ProductTypeId",
                table: "InstitutionSalesOrderItems");

            migrationBuilder.DropForeignKey(
                name: "FK_ProductTypes_DeviceTypes_DeviceTypeId",
                table: "ProductTypes");

            migrationBuilder.DropIndex(
                name: "IX_ProductTypes_DeviceTypeId",
                table: "ProductTypes");

            migrationBuilder.DropIndex(
                name: "IX_InstitutionSalesOrderItems_ProductTypeId",
                table: "InstitutionSalesOrderItems");

            migrationBuilder.DropColumn(
                name: "CreatedDate",
                table: "InstitutionSalesOrders");
        }
    }
}
